<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>个人中心</title>
<include file="./Public/public/public.html" />
</head>
<body>
<!--pc头部-->
<include file="./Public/public/top.html" />
<script>
        $(document).ready(function(){
            //取消订单
            var isCancelling = false;
            $("a[action='cancel_order']").click(function () {
                if (isCancelling) { showModal({msg:'操作正在进行，请稍候'}); return; }
                var _this = $(this);
                var _id = $(_this).attr('data-id');
                if (!_id) return;
                showConfirm({
                    msg:"您确定要取消该订单吗?",
                    confirmed:function(){
                        isCancelling = true;
                        $.ajax({
                            url:"{:U('UserEntrust/cancelTradeAgent')}",
                            type:"POST",
                            data:{id: _id},
                            success:function(resp){
                                isCancelling = false;
                                if (resp.status != 1) {
                                    showModal({msg:resp.msg});
                                } else {
                                    showModal({msg:resp.msg, callbackTime:1500, end:function(){ window.location.reload(true) }});
                                }
                            }
                        }).fail(function(){
                            isCancelling = false;
                        });
                    }
                })
            });
        });
    </script>
<!--pc头部结束-->
<div class="layout-wrap">
    <!--已审核-->
    <div class="layout">
    <include file="./Public/public/centerLeft.html" />
    <div class="right" ms-controller="right" style="min-height: 882px;">
        <h3>委托买卖</h3>
        <div class="split-dot mt10 mb10">
        </div>
        <div class="table-wrappper">
            <div class="table table-w200">
                <div class="th">
                    <div class="td w10"><span class="ml10">交易类型</span></div>
                    <div class="td w15"><span class="ml10">时间</span></div>
                    <div class="td w10"><span class="ml10">状态</span></div>
                    <div class="td w15"><span class="ml10">域名品种</span></div>
                    <div class="td w10"><span class="ml10">委托单价</span></div>
                    <div class="td w10"><span class="ml10">数量</span></div>
                    <div class="td w10"><span class="ml10">剩余</span></div>
                    <div class="td w10"><span class="ml10">操作</span></div>
                    <div class="clr"></div>
                </div>
                <if condition="$count neq 0">
						<volist name="list" id="vo">
							<div class="tr domain">
								<div class="td w10">
			                     	<span class="ml10">
			      						  <if condition="$vo.trans_type eq 1">
			                 				买入
					                 	  <elseif condition="$vo.trans_type eq 2"/> 
									    		卖出
								   		  </if>           
			                     	</span>
		                     	</div>
			                     <div class="td w15"><span class="ml10">{$vo.createdate}</span></div>
			                     <div class="td w10">
			                     	<span class="ml10">
			      						  <if condition="$vo.status eq 0">
			                 				进行中
					                 	  <elseif condition="$vo.status eq 1"/> 
									    	已结束
								    		<elseif condition="$vo.status eq 2"/> 
								    		已撤单
								   		  </if>           
			                     	</span>
		                     	</div>
			                     <div class="td w15"><span class="ml10">{$vo.domainType.name}</span></div>
			                     <div class="td w10"><span class="ml10">{$vo.unit_price}</span></div>
			                     <div class="td w10"><span class="ml10">{$vo.dnumber}</span></div>
             			         <div class="td w10"><span class="ml10">{$vo.surplus}</span></div>
        			             <div class="td w10">
        			             	<if condition="$vo.status eq 0 ">
		                 				<a class="button-s button-blue" action="cancel_order" data-id="{$vo.id}">
	                         			撤单
	                         			</a>
	                         		<elseif condition="$vo.status eq 1"/> 
									    	已结束
						    		<elseif condition="$vo.status eq 2"/> 
						    		已撤单  
						   		   </if>
        			             </div>
			                     <div class="clr"></div>
			                </div>
						</volist>
				<else/>
					<div class="empty" style="height:400px;"></div> 
				</if>
              </div>
        </div>
        <div class="pt10 pb10">
            <div class="dataTables_paginate paging_full_numbers">
                <div>
                                    </div>
            </div>
        </div>
    </div>

        <div class="clr"></div>
    </div>
</div>

<div popup="confirm" class="reveal-modal medium" topmeasure="50" topoffset="256" locked="false" animation="none" 
    animationspeed="500" closeonbackgroundclick="true" dismissmodalclass="close-reveal-modal" 
dismissjqobject="[action=&quot;cancel&quot;]" z-index="1001" switch="open" style="z-index: 1002; display: none; top: 650px;">
    <a class="close-reveal-modal" action="closeModal">×</a>
    <div class="confirm-inner">
            <img src="{$app_path}{$static_path}/img/icon_orange_question.png">
            <span action="msg"></span>
    </div>

    <div class="split-dot mb20 text-center"></div>
    <div class="form-row">
        <a action="confirm" class=" button button-orange w40 fl">知道了</a>
        <a action="cancel" class=" button button-gray w40 fr">取消</a>
        <div class="clr"></div>
    </div>
</div>

<include file="./Public/public/footer.html" />

</body></html>